package net.nightwhistler.pageturner.activity;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Menu;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

import com.shwread.android.qysw10000136.R;


public class VideoPlayActivity extends Activity {

	VideoView vv;

	@SuppressLint("NewApi")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// 去掉头信息
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);// 强制为横屏

		setContentView(R.layout.epub3_activity_video_play);
		Intent i = getIntent();

		vv = (VideoView) this.findViewById(R.id.videoView);
		vv.setMediaController(new MediaController(this));
		vv.setVideoPath(i.getStringExtra("tempVideoPath"));
		vv.requestFocus();
		vv.start();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.epub3_video_play, menu);
		return true;
	}

}
